package com.dhn.controller;

import com.dhn.entity.Sys_menus;
import com.dhn.entity.Sys_roles;
import com.dhn.service.Sys_menusService;
import com.dhn.service.Sys_rolesService;
import com.dhn.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
public class Sys_menusController {
    @Autowired
    private Sys_menusService sys_menusService;
    @RequestMapping("getSys_menus")
    @ResponseBody
    public Object getSys_menus(Sys_menus sys_menus){
        int total = sys_menusService.getTotal(sys_menus);
        sys_menus.setPage((sys_menus.getPage()-1)*sys_menus.getLimit());
        List<Sys_menus> list = sys_menusService.getSys_menus(sys_menus);
        return Result.toClient("0","",total,list);
    }
}
